-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix support for verify() and error type to fully support verify() in PSA/eBPF backend #3250
Conversation
…PSA/eBPF backend This PR fixes the support for verify() and error type to fully support them in eBPF backend. Works for PSA and filter architecture. Co-authored-by: Tomasz Osiński <[email protected]> Co-authored-by: Mateusz Kossakowski <[email protected]>
@@ -27,6 +27,38 @@ limitations under the License. | |||
|
|||
namespace EBPF { | |||
|
|||
class PSAErrorCodesGen : public Inspector { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a midend pass called convertErrors that could perhaps be used to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this class only to iterate over error codes and emit them into C code. Similarly is done for filter architecture.
I've prepared a PR in my fork which shows difference with this midend pass, especially this commit. In my opinion there is no profits from using convertErrors
pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds fine, it's a small amount of code.
BUG_CHECK(expression->arguments->size() == 2, "Expected 2 arguments: %1%", expression); | ||
|
||
auto errorExpr = expression->arguments->at(1)->expression; | ||
auto errorMember = errorExpr->to<IR::Member>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use the error elimination pass (see below) this code may need to change.
Should I merge this or do you plan further changes? |
I will merge this anyway |
…PSA/eBPF backend (p4lang#3250) This PR fixes the support for verify() and error type to fully support them in eBPF backend. Works for PSA and filter architecture. Co-authored-by: Tomasz Osiński <[email protected]> Co-authored-by: Mateusz Kossakowski <[email protected]>
Thank you. I have no plans for further changes. |
This PR fixes the support for verify() and error type to fully support them in eBPF backend. Works for PSA and filter architecture.
Co-authored-by: Tomasz Osiński [email protected]
Co-authored-by: Mateusz Kossakowski [email protected]